package com.swak.devtools.apidoc.api;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;

import com.swak.annotation.Get;
import com.swak.annotation.RestService;
import com.swak.devtools.apidoc.entity.Api;
import com.swak.devtools.apidoc.service.ApiDocService;
import com.swak.entity.Result;
import com.swak.utils.Lists;

/**
 * Api 服务.
 * 
 * @author DELL
 */
@RestService(value = "ApiDocApi", path = "/devtools")
public class ApiDocApi {

	@Autowired
	private ApiDocService apiDocService;

	@Get("/apidoc")
	public Result<List<Api>> apidoc() {
		return Result.success(Lists.newArrayList(apiDocService.getRouter().getRoutes().values()));
	}
}